import org.junit.Before;
import org.junit.Test;

import java.io.PrintStream;
import java.util.List;

import static com.google.common.collect.Lists.newArrayList;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.*;

public class ListPlayersCommandTest {
    String playerName = "Player1";
    Team team = new Team("Bears");
    List<Player> players;
    ListPlayersCommand listPlayersCommand;
    PrintStream printStream;


    @Before
    public void setUp() throws Exception {
        players = newArrayList(new Player(playerName, team, 12, 35));
        printStream = mock(PrintStream.class);
        listPlayersCommand = new ListPlayersCommand(printStream, players);
    }

    @Test
    public void shouldPrintListOfPlayersWhenActIsCalled() {

        listPlayersCommand.act();

        verify(printStream).println("Player: Player1, Team: Bears, Number: 12, Age: 35");
    }

}
